let init = function() {
    initEvent()
}
let initEvent = function() {
    $('#regBtn').on('click', onRegBtnClick)
}
let onRegBtnClick = async function() {
    let data = $('#regForm').serializeArray()
    let resResponse = await postUser(data)
    if (resResponse.code == 0) {
        sessionStorage.setItem('userToken', resResponse.token)
        location.replace('/login')
    } else {
        alert(resResponse.errInfo)
    }
}
init()